/* 树组件 */
<template>
  <div>
    <div v-for="item in this.menuList" :key="item.id" v-infinite-scroll="load">
      <el-submenu :index="item.id + ''" v-if="item.sysResourceList.length > 0">
        <template slot="title">
          <i :class="item.iconCode"></i><span>{{ item.name }}</span>
        </template>
        <MenuTree :menuList="item.sysResourceList" />
      </el-submenu>
      <el-menu-item
        v-else
        :index="item.url + ''"
        :router="true"
        @click="saveUrl(item.url)"
      >
        <i :class="item.iconCode"></i><span>{{ item.name }}</span>
      </el-menu-item>
    </div>
  </div>
</template>
<script>
export default {
  name: "MenuTree",
  props: ['menuList'],
  data() {
    return {
      count: 0,  
    }
  },
  methods: {
    saveUrl(path){
      window.sessionStorage.setItem("activePath",path);
} ,load () {
        this.count += 2
      },
  },
};
</script>
<style>
.el-menu--collapse span,
.el-menu--collapse i.el-submenu_icon-arrow {
  height: 0;
  width: 0;
  overflow: hidden;
  visibility: hidden;
  display: inline-block;
}
</style>
